package com.hp.team.bookstore.web.profile;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.hp.team.bookstore.model.profile.User;
import com.hp.team.bookstore.service.profile.ProfileService;

@Controller
@RequestMapping(value = "/users")
public class UserController {

	@Autowired
	private ProfileService profileService;

	@RequestMapping(value = "/all", method = RequestMethod.GET)
	public String getAllUsers(ModelMap model) {
		List<User> users = profileService.getAllUsers();
		model.put("users", users);
		return "allusers";
	}
}
